package com.bkgrands.fpmu.Retro;

import com.bkgrands.fpmu.classes.CMResponse;
import com.bkgrands.fpmu.classes.SetProgressResponse;
import com.bkgrands.fpmu.classes.UploadPhotoResponse;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

public interface APIInterface {
    @FormUrlEncoded
    @POST("api/login")
    Call<CMResponse> AuthUser(
            @Field("username") String uname,
            @Field("password") String password
    );

    @POST("api/login")
    Call<CMResponse> getJSON();

//    @FormUrlEncoded
//    @POST("api/upload_photo")
//    Call<UploadPhotoResponse> uploadImage(
//            @Field("photo") String file,
//            @Field("caption") String caption,
//            @Field("progress_id") String progress_id
//    );


    @Multipart
    @POST("api/upload_photo")
    Call<UploadPhotoResponse> uploadImage(@Part("photo\"; filename=\"myfile.jpg\" ") RequestBody file, @Part("caption") RequestBody caption, @Part("progress_id") RequestBody progress_id);


    @GET("api/set_status")
        //https://cm.bkgrandgh.com/api/set_status?
    Call<SetProgressResponse> setProgressStatus(
            @Query("min_stage_id") String mstageid,
            @Query("site_id") String siteid,
            @Query("tmpl_id") String tempid,
            @Query("hash") String hash,
            @Query("status") String status
    );

}